package PAT.乙.模拟;

import java.util.Scanner;

/**
 * 划拳
 *
 * @author yang
 * @date 2021/12/16
 */
public class 划拳 {

    public static void main(String[] args) {
        Scanner sc =  new Scanner(System.in);
        int aRes = 0;
        int bRes = 0;
        int n = sc.nextInt();
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt();
            int a1 = sc.nextInt();
            int b = sc.nextInt();
            int b1 = sc.nextInt();
            if ((a1 == a + b && b1 == a + b) || (a1 != a + b && b1 != a + b)) continue;
            if (a1 == a + b) bRes++;
            if (b1 == a + b) aRes++;
        }
        System.out.println(aRes +" "+ bRes);
    }
}
